package com.sz.app.customer.api.system;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sz.biz.app.web.BaseController;
import com.sz.biz.common.customer.service.CustomerMenuService;
import com.sz.common.base.dto.ResultDto;
import com.sz.common.core.system.dto.MenuItem;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@RequestMapping("${api}/u/menus")
@Api(description = " ", tags = "005、菜单资源")
public class MenuController extends BaseController{
	@Autowired
	private CustomerMenuService customerMenuService;
	
    @RequestMapping(value = "/menuandpermissiontree/{cusUserId}", method = {RequestMethod.GET})
    @ApiOperation(value = "获取指定角色下的菜单以及权限", notes = "获取指定角色下的菜单操作<br>权限：")
 
    public ResultDto getRolePermissionMenuTree(@ApiParam(value = "roleId", required = true) @PathVariable Integer cusUserId) {
        MenuItem root = customerMenuService.getMenuAndPermissionTree(cusUserId);
        ResultDto result = new ResultDto();
        result.setData(root);
        return result;
    }

}
